package com.example.novelstory.controller.jqx;

//import com.example.demo.entity.Novel;
//import com.example.demo.service.jzx.NovelServerImpl;
import com.example.novelstory.entity.Novel;
import com.example.novelstory.service.jzx.NovelServerImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@CrossOrigin
@Api(tags = "小说接口测试")
public class NovelController {
//    Resource mybatisPlus里面要用的
    @Resource
NovelServerImpl novelServer;
////    全查
    @PostMapping(value = "/findAkk")
    @ApiOperation(value = "测试全查接口")
    public List<Novel> testFindAkk(){
//        List<Novel> findAkk = novelServer.findAkk();
        return novelServer.list();
    }
////       增加
    @PostMapping(value = "/addNovel")
    @ApiOperation("添加小说接口")
    public boolean addNovel(Novel novel) {
//        List<Novel> addNovel = novelServer.addNovel(category,title,author,pic,content,tag,up,down,hits,rating,rating_count,serialize,favorites,position,template,link,create_time,update_time,reurl,status,hits_day,hits_week,hits_month,hits_time,word,recommend);
        return novelServer.addNovel(novel);
    }
////       删除
    @PostMapping(value = "/deleteNovel")
    @ApiOperation("小说删除接口")
    public boolean deleteNovel(int novel_id){
//        List<Novel> deleteNovel = novelServer.deleteNovel(id);
        return novelServer.deleteNovel(novel_id);
    }
////    条件查询
//    @RequestMapping(value = "/findByName",method = RequestMethod.POST)
//    @ApiOperation("条件查询小说接口")
//    public List<Novel> findByName(int author){
//        List<Novel> taskList = novelServer.findByName(author);
//        return taskList;
    }
//}
